FROM ubuntu:18.04
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ trusty main universe" >> /etc/apt/sources.list 
RUN apt-get update
RUN apt-get upgrade --assume-yes
 
RUN apt-get install  --assume-yes software-properties-common
RUN add-apt-repository ppa:openjdk-r/ppa
RUN apt-get update

# RUN apt-get install --assume-yes perl
# RUN apt-get update && apt-get install -y sudo
# RUN apt-get install --assume-yes python bc zip u-boot-tools 

ENV TZ=Asia/Shanghai
 
RUN apt-get update && \
    apt-get install -y tzdata && \
    ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
    echo $TZ > /etc/timezone && \
    dpkg-reconfigure -f noninteractive tzdata 

#    rm -rf /var/lib/apt/lists/*

ARG user=test

RUN useradd --create-home --no-log-init --shell /bin/bash ${user} \
    && adduser ${user} sudo \
    && echo "${user}:1" | chpasswd

RUN apt-get   install  --assume-yes   libgl1-mesa-dev g++-multilib git   gperf build-essential  \
              	libncurses5-dev  tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev   dpkg-dev libsdl1.2-dev   \
              	git-core gnupg flex bison gperf  zip curl zlib1g-dev gcc-multilib g++-multilib  \
              	libc6-dev-i386  lib32ncurses5-dev x11proto-core-dev libx11-dev  libgl1-mesa-dev libxml2-utils xsltproc unzip m4 \
              	lib32z-dev ccache  libssl-dev  python3 bc cpio rsync unzip zip wget   gnupg flex bison gperf  \
              	curl zlib1g-dev libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev \
              	libgl1-mesa-dev g++-multilib tofrodos  python-markdown libxml2-utils xsltproc vim cgpt uuid-dev  \
              	zlib1g-dev gcc-multilib  libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev \
              	lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip libncurses5 uuid-dev   \
              	u-boot-tools  bc  zip  python  sudo   \
              	libxml-simple-perl  mingw32 openjdk-8-jdk   \
	      	clang libyaml-dev  libtinfo*   \
		expect time  repo  ssh make gcc libssl-dev liblz4-tool expect g++ patchelf chrpath gawk   \
		texinfo chrpath diffstat binfmt-support qemu-user-static live-build bison flex fakeroot cmake    \
		unzip device-tree-compiler python-pip libncurses5-dev zstd rsync 


RUN update-alternatives --install /usr/bin/python  python /usr/bin/python2  27001
# RUN update-alternatives --install /usr/bin/python  python /usr/bin/python3  3600

USER  ${user}


